import yaml
import os

class Config:
    def __init__(self, env):
        # 获取当前脚本的目录
        current_dir = os.path.dirname(os.path.abspath(__file__))
        # 构建配置文件的路径
        config_path = os.path.join(current_dir, '..', 'config', 'config.yml')

        with open(config_path, 'r') as file:
            config = yaml.safe_load(file)
            self.base_url = config['environments'][env]['base_url']


if __name__ == '__main__':
    print(Config('test2').base_url)